package com.ming_za.od_updater_sdk.event;

import com.ming_za.od_updater_sdk.obj.UpdateError;

import java.util.List;

public class UpdateCompleteEvent {

    /**
     * 出错的版本
     */
    private final int errorVersion;

    /**
     * 错误列表
     */
    private final List<UpdateError> errorList;

    /**
     * 当前更新的总数（包括出错资源）
     */
    private final int updateCount;

    public UpdateCompleteEvent(int errorVersion, List<UpdateError> errorList, int updateCount) {
        this.errorVersion = errorVersion;
        this.errorList = errorList;
        this.updateCount = updateCount;
    }

    public boolean hasError(){
        return errorList != null && !errorList.isEmpty();
    }

    public List<UpdateError> getErrorList() {
        return errorList;
    }

    public int getErrorVersion() {
        return errorVersion;
    }

    public int getUpdateCount() {
        return updateCount;
    }
}
